package eunm;

/**
 * 枚举是一种引用类型
 * 枚举类型的对象数量是固定的,常常用于定义一组常量
 * 所有的枚举都继承Enum，其中提供了一组方法供我们使用
 * 枚举的构造方法是私有化的，禁止了new的途径
 */
public class EnumDemo {
    public static void main(String[] args) {
//        Season s=Season.AUTUMN;
        Season s=Season.valueOf("SPRING");
        System.out.println(s);
        System.out.println(Season.AUTUMN);

        Season[] seasons=Season.values();
        for (Season season:seasons) {
            System.out.println(season);
            System.out.println(season.getSeasonDesc());
            System.out.println(season.getSeasonName());
        }

        switch (s){
            case SPRING:
                System.out.println(s.getSeasonDesc());
            case SUMMER:
                System.out.println(s.getSeasonDesc());
            case AUTUMN:
                System.out.println(s.getSeasonDesc());
            case WINTER:
                System.out.println(s.getSeasonDesc());

        }




    }
}
